package com.global.college.ui.activity;

import android.os.Bundle;
import android.widget.TextView;

import com.global.college.R;
import com.global.college.base.BaseActivity;
import com.global.college.utils.TxtUtils;

import java.io.InputStream;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 服务条款说明
 */
public class HsLagelDetailActivity extends BaseActivity {
    @BindView(R.id.tv_hs_lage)
    TextView tvHsLage;
    @BindView(R.id.tv_title)
    TextView tvTitle;

    @Override
    public int getContentViewId() {
        return R.layout.activity_hs_lagel_detail;
    }

    @Override
    public void onCreateNew(Bundle savedInstanceState) {
        setShowTitleBar(true);
        setShowBack(true);
        String type = getIntent().getStringExtra("type");
        InputStream inputStream = null;
        switch (type) {
            case "0":
                inputStream = getResources().openRawResource(R.raw.software_lagel);
                tvTitle.setText(getString(R.string.heshu_soft_registration_agreement));
                setTitle(getString(R.string.heshu_soft_registration_agreement));
                break;
            case "1":
                inputStream = getResources().openRawResource(R.raw.privacy_policy);
                setTitle(getString(R.string.uton_soft_privacy_policy));
                tvTitle.setText(getString(R.string.uton_soft_privacy_policy));
                break;
        }
        String string = TxtUtils.getString(inputStream);
        tvHsLage.setText(string);
    }

    @Override
    public void getInitData() {

    }


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }
}